dofile("adds.lua")

dossier = 0
show = 0

blanc = Color.new (31, 31, 31)
gris = Color.new (15, 15, 15)
grisc = Color.new (20, 20, 20)
noir = Color.new (0, 0, 0)

touch = newBox (10,10,70,21)
hello = newBox (71,10,141,21)
hi = newBox (71,22,141,33)
dos1 = newBox (142,10,212,21)
dos2 = newBox (142,22,212,33)
dos3 = newBox (142,34,212,45)

while not Keys.newPress.Start do

Controls.read ()

startDrawing ()

if dossier == 1 and Stylus.heldinBox (hi, Stylus.X, Stylus.Y) then
dossier = 0
end

screen.drawFillRect (SCREEN_DOWN, 0, 0, 256, 192, blanc)
screen.drawRect (SCREEN_DOWN, 10, 10, 70, 21, noir)
screen.drawFillRect (SCREEN_DOWN, 11, 11, 69, 20, grisc)
if show == 0 or Stylus.released then
screen.drawFillRect (SCREEN_DOWN, 11, 11, 69, 20, gris)
end
screen.print (SCREEN_DOWN, 12, 12, "Touch me!", noir)

if Stylus.heldinBox (touch, Stylus.X, Stylus.Y) then show = 1 end

if show == 1 and Stylus.held then
if Stylus.released then show = 0 end
screen.drawRect (SCREEN_DOWN, 71, 10, 141, 21, noir)
if Stylus.heldinBox (hello, Stylus.X, Stylus.Y) then
screen.drawFillRect (SCREEN_DOWN, 72, 11, 140, 20, grisc)
else
screen.drawFillRect (SCREEN_DOWN, 72, 11, 140, 20, gris)
end
if dossier == 1 then
screen.drawFillRect (SCREEN_DOWN, 72, 11, 140, 20, grisc)
end
screen.print (SCREEN_DOWN, 73, 12, "Dossier   >", noir)

screen.drawRect (SCREEN_DOWN, 71, 22, 141, 33, noir)
if Stylus.heldinBox (hi, Stylus.X, Stylus.Y) then
screen.drawFillRect (SCREEN_DOWN, 72, 23, 140, 32, grisc)
else
screen.drawFillRect (SCREEN_DOWN, 72, 23, 140, 32, gris)
end
screen.print (SCREEN_DOWN, 73, 24, "Fichier    ", noir)
end

if Stylus.heldinBox (hello, Stylus.X, Stylus.Y) and show == 1 then dossier = 1 end


if dossier == 1 and show == 1 then
if Stylus.released then dossier = 0 end
screen.drawRect (SCREEN_DOWN, 142, 10, 212, 21, noir)
if Stylus.heldinBox (dos1, Stylus.X, Stylus.Y) then
screen.drawFillRect (SCREEN_DOWN, 143, 11, 211, 20, grisc)
else
screen.drawFillRect (SCREEN_DOWN, 143, 11, 211, 20, gris)
end
screen.print (SCREEN_DOWN, 145, 12, "Fichier    ", noir)

screen.drawRect (SCREEN_DOWN, 142, 22, 212, 33, noir)
if Stylus.heldinBox (dos2, Stylus.X, Stylus.Y) then
screen.drawFillRect (SCREEN_DOWN, 143, 23, 211, 32, grisc)
else
screen.drawFillRect (SCREEN_DOWN, 143, 23, 211, 32, gris)
end
screen.print (SCREEN_DOWN, 145, 24, "Fichier    ", noir)

screen.drawRect (SCREEN_DOWN, 142, 34, 212, 45, noir)
if Stylus.heldinBox (dos3, Stylus.X, Stylus.Y) then
screen.drawFillRect (SCREEN_DOWN, 143, 35, 211, 44, grisc)
else
screen.drawFillRect (SCREEN_DOWN, 143, 35, 211, 44, gris)
end
screen.print (SCREEN_DOWN, 145, 36, "Fichier    ", noir)
end

if not Stylus.held then
dossier = 0
show = 0
end

stopDrawing ()

end